﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Chuancanprojct.Controllers
{
    public class StudentController : Controller
    {
        // GET: Student
        public ActionResult Index()
        {
            ViewBag.PageTitle = "学生管理系统";
            return View();
        }
        public ActionResult List()
        {
            List<Student> studentsList = new List<Student>();
            for (int i =1;i<6;i++)
            {
                var stu = new Student { Name=string.Format("学生{0}",i),Age="20"};
                studentsList.Add(stu);
            }
            ViewBag.List = studentsList;
            return View();
        }

    }
    public class Student
    {
        public string Name { get; set; }
        public string Age { get; set; }
    }
 }